<template>
  <van-sticky>
    <van-nav-bar>
      <div slot="left">
        <personBtn></personBtn>
      </div>
      <ul class="serch-ul" slot="title">
        <li :class="{active:tardeNumshow==0}" @click="tardeNumset(0)">My optional</li>
        <li :class="{active:tardeNumshow==1}" @click="tardeNumset(1)">Prices</li>
      </ul>
      <div class="indexdom" slot="right">
          <phoneDom></phoneDom>
        </div>
    </van-nav-bar>
  </van-sticky>
</template>

<script>
import phone from "../../assets/img/phone.png";
import personBtn from "../person/personBtn";
import phoneDom from "./phone";
export default {
  components: {
    personBtn,
    phoneDom
  },
  props: ["tardeNum"],
  data() {
    return {
      phone,
      phoneNum: this.$store.state.nocaches.kefuphone
    };
  },
  computed: {
    tardeNumshow() {
      return this.tardeNum;
    }
  },
  methods: {
    tardeNumset(i) {
  if (i == 0 && this.$store.state.nocaches.notMemberobj.notMember) {
        this.$store.commit("munotMember", {
          notMember: true, //是否是该频道会员
          notMembershow: true
        });
        return false;
      }
      let islogin = this.$store.state.islogin;
      if (!islogin) {
         this.$store.commit("muloginmoduleshow",true)
        return false;
      }
      this.$emit("showbar", i);
    }
  }
};
</script>

<style scoped lang="less">
.van-nav-bar {
  display: flex;
  align-items: center;
}
.serch-ul {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 0.02rem solid #ffffff;
  height: 0.6rem;
  border-radius: 0.06rem;
  li {
    height: 100%;
    font-size: 0.3rem;
    padding: 0.05rem 0.5rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    &.active {
      color: rgba(31, 135, 229, 1);
      background: #ffffff;
    }
  }
}
</style>
